Q: В микросервисе на Spring Boot с REST API начали замечать зависания и таймауты при обращении к стороннему API. Подключение через RestTemplate. Как можно диагностировать и устранить проблему?
A: Проблема, скорее всего, в отсутствии или неправильной настройке таймаутов у RestTemplate. По умолчанию они не выставлены, и поток может висеть бесконечно, дожидаясь ответа от внешнего сервиса.
Что делать:
— Проверить и настроить таймауты (.setConnectTimeout(Duration.ofSeconds(Х)) и .setReadTimeout(Duration.ofSeconds(Х)) ) — Добавить Circuit Breaker (например, через Resilience4j) — чтобы сервис не падал, если внешнее API умирает. — Логировать время ответа, чтобы видеть деградацию раньше.
Q: В микросервисе на Spring Boot с REST API начали замечать зависания и таймауты при обращении к стороннему API. Подключение через RestTemplate. Как можно диагностировать и устранить проблему?
A: Проблема, скорее всего, в отсутствии или неправильной настройке таймаутов у RestTemplate. По умолчанию они не выставлены, и поток может висеть бесконечно, дожидаясь ответа от внешнего сервиса.
Что делать:
— Проверить и настроить таймауты (.setConnectTimeout(Duration.ofSeconds(Х)) и .setReadTimeout(Duration.ofSeconds(Х)) ) — Добавить Circuit Breaker (например, через Resilience4j) — чтобы сервис не падал, если внешнее API умирает. — Логировать время ответа, чтобы видеть деградацию раньше.
Mr. Durov launched Telegram in late 2013 with his brother, Nikolai, just months before he was pushed out of VK, the Russian social-media platform he founded. Mr. Durov pitched his new app—funded with the proceeds from the VK sale—less as a business than as a way for people to send messages while avoiding government surveillance and censorship.
That growth environment will include rising inflation and interest rates. Those upward shifts naturally accompany healthy growth periods as the demand for resources, products and services rise. Importantly, the Federal Reserve has laid out the rationale for not interfering with that natural growth transition.It's not exactly a fad, but there is a widespread willingness to pay up for a growth story. Classic fundamental analysis takes a back seat. Even negative earnings are ignored. In fact, positive earnings seem to be a limiting measure, producing the question, "Is that all you've got?" The preference is a vision of untold riches when the exciting story plays out as expected.
Библиотека собеса по Java | вопросы с собеседований from ye